home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Software of the Month Club
/
Amiga General Interest Volume 210 (1995-03)(SOMC)(Disk 2 of 5)[SMC210C30I2].zip
/
Amiga General Interest Volume 210 (1995-03)(SOMC)(Disk 2 of 5)[SMC210C30I2].adf
/
MathScript
/
Rexx
/
InsertFormula.ms
< prev
next >
Wrap
Text File
|
1995-05-26
|
3KB
|
119 lines
/* This script is for the use with FinalWriter®.
For the detailed description of how to connect MathScript and FinalWriter®
via ARexx, see the file FinalWriter.guide in your Docs drawer */
/*************************************************************************
This script can use the current font size and color of FinalWriter.
If you do not want it to use the current font size, set use_size="No".
If you do not want it to use the current font color, set use_color="No"
You maybe should create different script files with different settings if
you often need different settings.
*************************************************************************
Dieses Script benutzt die in FinalWriter eingestellte Font-Größe und -Farbe.
Wenn Sie nicht die aktuelle Font-Größe benutzen wollen, setzen Sie: use_size="No".
Wenn Sie nicht die aktuelle Farbe benutzen wollen, setzen Sie: use_color="No".
Wenn Sie häufig verschiedene Einstellungen für dieses Script brauchen,
erstellen Sie doch einfach mehrere Versionen!
*************************************************************************/
use_size="Yes"
use_color="Yes"
options results
IF ~SHOW('p',"FINALW.1") THEN EXIT
/* If FW does not run -> quit */
DO i=0 WHILE EXISTS("T:formula"||i)
END
ADDRESS FINALW.1
STATUS FONTSIZE
size=result
/* Get the current font size */
STATUS FONTCOLOR
colorname=result
/* Get the current color */
GETDOCCOLORPREFS colorname
color=result
PARSE VAR color r g b
r=r*16
g=g*16
b=b*16
/* convert color to 8bit R,G,B values */
STATUS PAGE "Insert"
page=result
/* The formula will be inserted into the current page */
ADDRESS "MATHSCRIPT.1"
GETGENERALPREFS FONTSIZE
old_size=result
IF use_size="Yes" THEN
SETGENERALPREFS FONTSIZE size
/* Use the current font size if use_size=Yes*/
GETGENERALPREFS FG
old_fg=result
IF use_color="Yes" THEN
SETGENERALPREFS FG r||","||g||","||b
/* Use the current font color if use_color=Yes */
GETDIMENSIONS
dimensions=result
w=WORD(dimensions,1)*10
h=WORD(dimensions,2)*10
/* Get the formula's size in micropoints */
EXPORT BINEPS "T:formula"||i FORCE
/* save as Binary EPS */
SETGENERALPREFS FONTSIZE old_size
SETGENERALPREFS FG old_fg
/* restore old settings */
ADDRESS "FINALW.1"
SETMEASURE MICROPOINTS
CURRENTOBJECT
id=result
x=-1
y=-1
IF id~=0 THEN
DO
GETOBJECTCOORDS id
page=WORD(result,1)
x=WORD(result,2)
y=WORD(result,3)
DELETEOBJECT id
END
/* Use position of selected object (if there is one) */
SCREENTOFRONT
GETIMPORTPREFS TEXTFLOW LINKED DISPLAY
PARSE VAR result t l d
IMPORTPREFS DISPLAY PREVIEW TEXTFLOW NONE LINKED NO
INSERTIMAGE "T:formula"||i POSITION page x y w h
/* load the EPS-file into FW */
REDRAW
IMPORTPREFS TEXTFLOW t LINKED l DISPLAY d